import http from "@/utils/https";

// 小程序登录_内测版

export const loginSimple = (phoneNumber) => {
  return http({
    url: '/login/wxMin/simple',
    method: 'post',
    data: { phoneNumber }
  })
}

// 小程序登录
export const loginWxmin = (data) => {
  return http({
    url: '/login/wxMin',
    method: 'post',
    data
  })
}
// 获取个人信息
export const getMemberProfile = () => {
  return http({
    url: '/member/profile'
  })
}

//个人信息-修改
export const putMemberProfile = (data) => {
  return http({
    url: '/member/profile',
    method: 'put',
    data
  })
}

//获取收货地址列表 /member/address 
export const getMemberAddress = () => {
  return http({
    url: '/member/address'
  })
}
// 添加收货地址 /member/address
export const addMemberAddress = (data) => {
  return http({
    url: '/member/address',
    method: 'post',
    data
  })
}
// 删除收货地址
export const deleteMemberAddress = (id) => {
  return http({
    url: `/member/address/${id}`,
    method: 'delete'
  })
}

// 查询收货地址详情  /member/address/{id}

export const getMemberAddressDetail = (id) => {
  return http({
    url: `/member/address/${id}`
  })
}
// 更新收货地址
export const putMemberAddress = (data) => {
  return http({
    url: `/member/address/${data.id}`,
    method: 'put',
    data
  })
}